<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Interactive Menu with Frames</title>
    <link href="https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&display=swap" rel="stylesheet">
    <style>
        body {
            margin: 0;
            font-family: 'Comic Neue', cursive;
            background: white;
            display: flex;
            height: 100vh;
            overflow: hidden;
        }
        .sidebar {
            width: 200px;
            background: linear-gradient(135deg, #5a9bf6, #7ec8ff);
            color: white;
            height: 100vh;
            display: flex;
            flex-direction: column;
            padding: 1em;
            box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
        }
        .sidebar h2 {
            font-size: 1.8em;
            text-align: center;
            margin-bottom: 1em;
            border-bottom: 2px solid white;
            padding-bottom: 0.5em;
            font-weight: 700;
        }
        .sidebar ul {
            list-style: none;
            padding: 0;
            margin: 0;
            flex-grow: 1;
        }
        .sidebar ul li {
            padding: 0.8em 1.2em;
            cursor: pointer;
            transition: background 0.3s, transform 0.3s;
            border-radius: 5px;
            margin: 0.3em 0;
            display: flex;
            align-items: center;
            font-size: 1.1em;
            font-weight: 700;
        }
        .sidebar ul li:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: scale(1.05);
        }
        .sidebar ul li i {
            margin-right: 10px;
            font-size: 1.5em;
        }
        .sidebar .footer {
            text-align: center;
            padding: 1em 0;
            border-top: 1px solid rgba(255, 255, 255, 0.3);
            font-size: 0.9em;
        }
        .main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            height: 100vh;
        }
        .topbar {
            width: 100%;
            background: linear-gradient(135deg, #5a9bf6, #7ec8ff);
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1em;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            z-index: 100;
        }
        .topbar button {
            background: #f9f9f9;
            color: rgb(4, 0, 0);
            padding: 0.5em 1em;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 1em;
            font-weight: 600;
            margin-left: 1em;
        }
        .topbar button:hover {
            background: #1d6ac0;
        }
        .topbar .profile {
            display: flex;
            align-items: center;
        }
        .topbar .profile img {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            right:70px;
            position:absolute;
        }
        .content {
            flex: 1;
            display: flex;
            flex-wrap: wrap;
            padding: 2em;
            transition: transform 0.3s ease;
            justify-content: center;
            align-items: center;
            position: relative;
            overflow-y: auto;
        }
        .frame {
            width: 45%;
            height: 45%;
            margin: 1em;
            padding: 1em;
            box-sizing: border-box;
            transition: transform 0.3s ease, background 0.3s ease;
            border-radius: 10px;
            position: relative;
            background: rgba(90, 155, 246, 0.2);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            backdrop-filter: blur(5px);
        }
        .frame:hover {
            transform: scale(1.05);
            background: rgba(90, 155, 246, 0.5);
            color: white;
            z-index: 1;
        }
        .frame h2 {
            margin: 0;
            font-size: 1.5em;
            color: #333;
        }
        .frame:hover h2 {
            color: white;
        }
        .frame i {
            font-size: 2em;
            color: #5a9bf6;
        }
        .frame:hover i {
            color: white;
        }
        .frame-content {
            height: 100%;
            border-radius: 10px;
            padding: 1em;
            box-sizing: border-box;
            overflow: hidden;
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .todo-count {
            position: absolute;
            top: 10px;
            right: 10px;
            background: #ff6347;
            color: white;
            padding: 5px 10px;
            border-radius: 50%;
            font-size: 1em;
            font-weight: bold;
        }
        .fullscreen-iframe {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: none;
            z-index: 9999;
            background: white;
        }
        .back-button {
            position: absolute;
            top: 10px;
            right: 10px;
            background: #0f3f70;
            color: white;
            padding: 0.5em 1em;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 1em;
            font-weight: 600;
            z-index: 10000;
        }
    </style>
</head>
<body>
    <div class="sidebar">
        <h2>目录</h2>
        <ul>
            <li onclick="showFrames('submenu1-frame')"><i class="fas fa-folder-open"></i>JAVA Programming</li>
            <li onclick="showFrames('submenu2-frame')"><i class="fas fa-folder-open"></i>Statistics</li>
            <li onclick="showFrames('submenu3-frame')"><i class="fas fa-folder-open"></i>Data Structure</li>
            <li onclick="showFrames('submenu4-frame')"><i class="fas fa-folder-open"></i>Web Design & Programming</li>
            <li onclick="showFrames('submenu5-frame')"><i class="fas fa-folder-open"></i>Database Management</li>
        </ul>
        <div class="footer">
            &copy; 2024 My Website
        </div>
    </div>
    <div class="main-content">
        <div class="topbar">
            <div>
                <button onclick="location.reload();">Refresh</button>
                <button onclick="window.location.href='/login'">Login</button>
            </div>
            <div class="profile">
                <img src="Quiz2/Quiz/static/pictures/logo.jpg" alt="Profile Picture">
            </div>
        </div>
        <div class="content" id="content">
            <div class="frame">
                <div class="frame-content">
                    <span class="todo-count">3</span>
                    <i class="fas fa-book-open"></i>
                    <a href=""><h2>Homework</h2></a>
                    <img src="../../static/pictures/homework.png" alt="Homework Image" style="width: 70%; height: 100%; background: transparent;">
                </div>
            </div>
            <div class="frame">
                <div class="frame-content">
                    <span class="todo-count">1</span>
                    <i class="fas fa-pen-fancy"></i>
                    <a href="/quiz"><h2>Quiz</h2></a>
                    <img src="../../static/pictures/quiz.png" alt="Homework Image" style="width: 70%; height: 100%; background: transparent;">
                </div>
            </div>
            <div class="frame">
                <div class="frame-content">
                    <span class="todo-count">2</span>
                    <i class="fas fa-calendar-alt"></i>
                    <a href="/schedule"><h2>Schedule</h2></a>
                    <img src="../../static/pictures/schedule.png" alt="Homework Image" style="width: 57%; height: 100%; background: transparent;">
                </div>
            </div>
            <div class="frame">
                <div class="frame-content">
                    <span class="todo-count">5</span>
                    <i class="fas fa-bell"></i>
                    <a href="/notice"><h2>Notice</h2></a>
                    <img src="../../static/pictures/notice.png" alt="Homework Image" style="width: 57%; height: 100%; background: transparent;">
                </div>
            </div>
        </div>
    </div>
    <script>
        function showFrames(frameId) {
            // Hide all content divs
            var contentDivs = document.querySelectorAll('.content');
            contentDivs.forEach(function(div) {
                div.style.display = 'none';
            });

            // Show the selected content div
            document.getElementById(frameId).style.display = 'flex';
        }
    </script>
    <script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script>
</body>
</html>
